/*
 * H26xPropChecker.cpp
 *
 *  Created on: 2022-01-27
 *      Author: chuanjiang.zh
 */

#include "H26xPropChecker.h"
#include "H26xPropDetector.h"

class H26xPropCheckerPrivate
{
public:
	av::H26xPropDetector detector;
};


H26xPropChecker::H26xPropChecker(int codecID):
	m_pimpl(new H26xPropCheckerPrivate())
{
	m_pimpl->detector.setCodec(codecID);
}

H26xPropChecker::~H26xPropChecker()
{
}

bool H26xPropChecker::setCodec(int codecID)
{
	return m_pimpl->detector.setCodec(codecID);
}

bool H26xPropChecker::detect(const uint8_t* data, int size, bool& isKeyFrame, int& naluType)
{
	return m_pimpl->detector.detect(data, size, isKeyFrame, naluType);
}

bool H26xPropChecker::isReady() const
{
	return m_pimpl->detector.isReady();
}

void H26xPropChecker::clear()
{
	m_pimpl->detector.clear();
}

H26xPropChecker::Str H26xPropChecker::getProp() const
{
	Str str;
	str.first = m_pimpl->detector.getProp(str.second);
	return str;
}

H26xPropChecker::Str H26xPropChecker::getVps() const
{
	Str str;
	str.first = m_pimpl->detector.getVps(str.second);
	return str;
}

H26xPropChecker::Str H26xPropChecker::getSps() const
{
	Str str;
	str.first = m_pimpl->detector.getSps(str.second);
	return str;
}

H26xPropChecker::Str H26xPropChecker::getPps() const
{
	Str str;
	str.first = m_pimpl->detector.getPps(str.second);
	return str;
}

void H26xPropChecker::setProp(const uint8_t* sprop, int size)
{
	m_pimpl->detector.setProp(sprop, size);
}